import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login')
  },
  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/anime',
    children: [
      {
        path: 'anime',
        name: 'anime',
        component: () => import('@/views/anime/index.vue')
      },
      {
        path: 'system',
        name: 'system',
        component: () => import('@/views/system/index.vue')
      },
      {
        path: '/episode/:id',
        name: 'episode',
        component: () => import('@/views/episode/index.vue')
      },
      {
        path: '/comment/:id',
        name: 'comment',
        component: () => import('@/views/comment/index.vue')
      },
      {
        path: 'users',
        name: 'users',
        component: () => import('@/views/users/index.vue')
      },
      {
        path: 'eventQueue',
        name: 'eventQueue',
        component: () => import('@/views/eventQueue/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
